Skip to content

Conversation

@Mikah-Kainen
Copy link
Collaborator

No description provided.

michaelborkowski and others added 6 commits March 19, 2025 18:29
Professor Borkowski fixed these issues:
 - Merge sort works on all backends
 - Quick sort works on all backends
 - The property test that swap is commutative now passes

Remaining known issues with mutable backends:
 - splitMid returns arrays with changed elements
 - Swapping an index with itself changes the element at that index
 - makeArray doesn’t initialize elements to the proper value
The test cases incorrectly assumed that makeArray initializes elements on
the mutable backends and that fromList is defined for size 0.
This commit updates the test suite to account for these issues by:

 - Removing tests that makeArray initializes elements for mutable backends.
 - Using replicate and fromList in splitMid tests to initialize elements.
 - Copying arrays when testing the commutativity of swaps.
 - Removing 0 from the range of fromList calls.

There is still one failing test. This is the test for swapping the same index,
which only fails on the prim-mutable-arrays backend.

Other changes:
 - Replace type annotations with type applications to improve readability.
 - Set the default-language of the test suite to GHC2021.
@Mikah-Kainen Mikah-Kainen force-pushed the fix-failing-array-tests branch from 7abbea2 to 3917c4d Compare March 22, 2025 22:01
@Mikah-Kainen Mikah-Kainen merged commit df58114 into main Mar 22, 2025
4 of 5 checks passed
@Mikah-Kainen Mikah-Kainen deleted the fix-failing-array-tests branch March 22, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants